package org.elte.lipika;

import org.springframework.roo.addon.entity.RooEntity;
import org.springframework.roo.addon.javabean.RooJavaBean;
import org.springframework.roo.addon.tostring.RooToString;
import org.elte.lipika.Terminus;
import javax.persistence.ManyToOne;
import org.elte.lipika.Source;

@RooJavaBean
@RooToString
@RooEntity
public class Occurence {

    @ManyToOne(optional=false)
    private Terminus terminus;

    @ManyToOne
    private Source source;

    private String page;

    private String imageId;
    
    @Override
    public String toString(){
    	return new StringBuilder().append(this.getSource().getAuthor()).append(":").append(this.getSource().getTitle()).append("; ").append(this.getPage()).toString();
    }
}
